home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / gus / demovt15.zip / DEMOVT.DOC < prev    next >
Text File  |  1994-04-26  |  29KB  |  650 lines

  1.  
  2.  
  3.  
  4.            What it is, and how to use it
  5.            ─────────────────────────────
  6.  
  7.            Let's  talk  about DemoVT.  It's a program that is capable of
  8.         playing  a  MOD  music while another program is running.  If you
  9.         know  what  the  ShellVT  program  is,  then  the  DemoVT  is  a
  10.         "slightly"  modified  version.  Its  primary use is intended for
  11.         graphics demonstrations (demos)  and games, but it could be used
  12.         for  other  kinds  of  applications.   It  should  work  on  286
  13.         machines, but it has only been tried on 386SX and above.
  14.  
  15.            It  is  NOT a TSR program.  Instead,  when it is run it loads
  16.         the  music  file  and  then executes another program via the DOS
  17.         EXEC  function.  When  the  executed program terminates,  DemoVT
  18.         terminates also (more on this later).
  19.  
  20.            It  is NOT a stand alone background modplayer.  It requires a
  21.         minimal  (and allows a maximal)  collaboration with the executed
  22.         program.  ShellVT  is  a great stand alone choice if that's what
  23.         you want ;-)
  24.  
  25.          DEMOVT   test.mod  /f:20000  /d:DMA-SB-Mono  /port:$220  /irq:7
  26.         /dma:1 /v:74 /sh:test1.exe
  27.  
  28.            The  above (it should have been just one line)  is an example
  29.         of  how to play the TEST.MOD file through the Sound Blaster card
  30.         at  220-7-1,  at  a  sample rate of 20000 Hz and a volume of 74,
  31.         while running the TEST1.EXE program.
  32.  
  33.            Sample  rates  range  from  4000  to  44100  Hz (it won't get
  34.         higher than your card allows). Possible devices are:
  35.  
  36.          Silence       - No sound. Quiet. interprets the music anyway.
  37.          DMA-SB-Mono   - Any Sound Blaster in mono. Also PAS cards.
  38.          DMA-SB-Stereo - SB Pro and SB 16 in stereo.
  39.          GUS           - Gravis Ultrasound. Fixed rate of 44100 Hz.
  40.  
  41.            Port,  IRQ  and  DMA range to any available to your favourite
  42.         card.  You  don't  want  us  to list all different possibilities
  43.         here,  do you?  Volumes are from 0 to 127. The /sh: program file
  44.         should have the file extension and the path if necessary.
  45.  
  46.            In  'silence'  mode, DemoVT will use a serial port for timing
  47.         (this  lets  you  use  the  timer 0 for your own purposes).  Any
  48.         serial  port  is  useable,  but it will use COM1 by default.  To
  49.         change it, just use the /port: and /irq: options:
  50.  
  51.                   COM1 - /d:Silence /port:$3F8 /irq:4
  52.                   COM2 - /d:Silence /port:$2F8 /irq:3
  53.                   COM3 - /d:Silence /port:$3E8 /irq:4
  54.                   COM4 - /d:Silence /port:$2E8 /irq:3
  55.  
  56.            IRQ  values  for  COM3  and  COM4  are usually changed to any
  57.         other.  COM2  to COM4 may be absent,  but DemoVT will not detect
  58.         this and will hang.
  59.  
  60.  
  61.  
  62.            DemoVT script files
  63.            ───────────────────
  64.  
  65.            Above  we said that DemoVT finishes when the executed program
  66.         terminates.  That's not completely true.  In fact, it's possible
  67.         to  keep  the DemoVT running after that.  How?  Using scripts to
  68.         make  the  DemoVT  load  a  (possibly)  different MOD and/or run
  69.         another  (possibly)  different  program.  If  you  did  this  by
  70.         executing   repeatedly   DemoVT,   the   sound  card  would  get
  71.         initialised each time, thus making an awful click.
  72.  
  73.            Create a text file with this:
  74.  
  75.          ; -------------- Start of TEST.VTO --------------------
  76.  
  77.          /f:44100         ; 44100 Hz
  78.          /d:DMA-SB-Stereo ; Stereo Sound Blaster.
  79.          /port:$220       ; Sound Blaster Port.
  80.          /irq:7           ; Sound Blaster IRQ.
  81.          /dma:1           ; Sound Blaster DMA.
  82.          /v:127           ; Sound volume.
  83.  
  84.                  test1.mod /sh:test1.exe    ; 1st MOD & 1st program.
  85.          / /v:74 test2.mod /sh:test2.exe    ; 2nd MOD & 2nd program.
  86.                                             ; Volume of 127
  87.  
  88.          ; --------------- End of TEST.VTO ---------------------
  89.  
  90.            Note  the  "/"  at the start of the second MOD/Program.  It's
  91.         required  to  make  the first ones to be executed.  It separates
  92.         the  different  execution  lines.  Also,  it's important to make
  93.         /sh:  the  last  switch in the line.  You can add a full command
  94.         line  to  the  program  if  you  want.  And  you  can really add
  95.         comments starting with ";".
  96.  
  97.            The above script would be used executing:
  98.  
  99.          DEMOVT @test.vto
  100.  
  101.            For  those  of  you  who have seen it,  the Inconexia Demo by
  102.         Iguana  generates  a  script  like  the above,  bigger,  with an
  103.         executable file for each part.
  104.  
  105.            If you want to run several programs under a unique MOD,  like
  106.         different  parts  of  a trackmo,  just specify the MOD file only
  107.         with  the first executable.  As an example,  here's included the
  108.         VTO that runs the whole Inconexia demo:
  109.  
  110.          ; --------------- End of INCONEXI.VTO ---------------------
  111.  
  112.          /d:gus        ; Use the Gravis Ultrasound.
  113.          /port:$240    ; GUS Port.
  114.          /irq:11       ; GUS Irq.
  115.          /v:80         ; Initial volume.
  116.  
  117.            inconexi.003        /sh:inconexi.004
  118.          / inconexi.005        /sh:inconexi.006
  119.          / inconexi.008        /sh:inconexi.009
  120.          /                     /sh:inconexi.010
  121.          /                     /sh:inconexi.011
  122.          /                     /sh:inconexi.012
  123.          /                     /sh:inconexi.013
  124.          / inconexi.014 /v:128 /sh:inconexi.015
  125.  
  126.          ; --------------- End of INCONEXI.VTO ---------------------
  127.  
  128.  
  129.  
  130.            Advanced options
  131.            ────────────────
  132.  
  133.            To  play  the  MOD  from  a different sequence position (i.e.
  134.         14),  use  the  following switch: /ss:14 Also,  use the switches
  135.         /sl:22  and  /sr:18  to load only the sequence up to position 22
  136.         and to repeat from position 18.  All values range from 1 to 128.
  137.         Experiment with this.
  138.  
  139.            If  you  want  to  have  the  MOD file stored inside a bigger
  140.         file,  you  can  use the switch /off:193847.  This will load the
  141.         MOD from position 193847 in the file. Also, experiment with it.
  142.  
  143.  
  144.  
  145.            Synchronisation
  146.            ───────────────
  147.  
  148.            This  is  the big thing in DemoVT that makes it very special.
  149.         It's  also  very tricky,  so we advice you to read all this very
  150.         carefully  and  look  into  the  examples.  And,  of course,  to
  151.         experiment a lot with it.
  152.  
  153.            The  first  thing  to  talk  about is the delay.  When DemoVT
  154.         interprets  the MOD's partiture,  it does it half a second ahead
  155.         of  the  sound  it  generates.  The important thing is to always
  156.         remember  this  delay  when interacting with the music (changing
  157.         the  volume or jumping in the partiture).  DemoVT will hide this
  158.         delay  when  it tells you about its state,  but you will have to
  159.         keep it in mind when you try to alter DemoVT's state.
  160.  
  161.            The first way to synchronize is using semaphores.  There's an
  162.         array  of 256 semaphores; each of them gets incremented whenever
  163.         a  command  number  8  is  found in any channel of the MOD.  The
  164.         parameter  of this command tells which one of the 256 semaphores
  165.         gets  incremented.  Your program can check any semaphore anytime
  166.         for  a  given  value,  to  see if the music has passed through a
  167.         point in the partiture.  When DemoVT is started,  all semaphores
  168.         are set to zero.
  169.  
  170.            The  second  way to synchronize is using precise timing.  The
  171.         DemoVT  provides  you  with  a  counter that gets incremented 50
  172.         times  per  second,  and  which is also used for the MOD timing.
  173.         You  can  read  it  and therefore know exactly how much time has
  174.         passed  since  the  music started.  DemoVT also lets you control
  175.         exactly  when  does  the  music start.  In fact,  DemoVT doesn't
  176.         start playing until you explicitly tell.
  177.  
  178.  
  179.  
  180.            Modes of operation
  181.            ──────────────────
  182.  
  183.            DemoVT  can  operate in Poll Mode or Timer Mode.  When DemoVT
  184.         starts it is in Poll Mode. Read below for more information.
  185.  
  186.  
  187.  
  188.            Ok! What else?
  189.            ──────────────
  190.  
  191.            Now  that I've got you interested,  I'll tell you a couple of
  192.         things.
  193.  
  194.            This is what I expect from you:
  195.  
  196.            First,  if  you  use  this,  you  MUST  credit  me:  JCAB  of
  197.         VangeliSTeam/Iguana.
  198.  
  199.            Second,   if   you   have   used  DemoVT  for  non-profitable
  200.         non-commercial purposes,  please contact me at the address below
  201.         and  tell  me  what  you  used  it for,  and how you did it.  If
  202.         possible,  send  me  a  copy of the program or whatever you have
  203.         made  using  the  DemoVT.   You'll  be  sent  greetings  in  the
  204.         following releases.
  205.  
  206.            Third,  if  you're  going  to  use it for a commercial and/or
  207.         profitable  purpose,  you must first contact me to get a written
  208.         permission.
  209.  
  210.            You  could  also  use  it  without  paying,   contacting  nor
  211.         crediting me. If you do so then fuck you.
  212.  
  213.            If   you  find  this  program  worth  it,   you  can  send  a
  214.         contribution  of  $10,  or  anything  you  feel is fair,  to the
  215.         address below.
  216.  
  217.            You  are  also encouraged to send any comments about anything
  218.         you  want  concerning  the  program  and/or  documentation,   or
  219.         questions about your particular use of DemoVT.  Please,  enclose
  220.         a self-addressed,  stamped envelope if you expect an answer.  It
  221.         would be very encouraging to receive feedback about my work.
  222.  
  223.            This  program  is  Copyrighted  by Juan Carlos Arévalo Baeza,
  224.         aka  VangeliSTeam,  and is thus protected by copyright laws.  It
  225.         is  not  public  domain;  it can be freely distributed,  but can
  226.         only be used under the conditions stated above.
  227.  
  228.            DISCLAIMER:
  229.  
  230.            This  document  is  just  the  description of what I use this
  231.         program for,  and how I do it. It's enough for me, but I give no
  232.         kind  of warranty about the way it behaves,  and won't be liable
  233.         for any kind of damages it could cause to anybody else.
  234.  
  235.            CONTACT ADDRESS:
  236.  
  237.         ┌──────────────────────────┐
  238.         │ Juan Carlos Arévalo      │
  239.         │ Apdo. de Correos 156.405 │
  240.         │ 28080 - Madrid           │
  241.         │ Spain                    │
  242.         └──────────────────────────┘
  243.  
  244.            Also, electronically:
  245.  
  246.          Fidonet:   2:341/27.16
  247.          CDNet:    94:620/200.1
  248.          SoundNet: 34:2000/200.16
  249.          Internet: jcarlos@gw.iic.uam.es
  250.                    jarevalo@dit.upm.es    (more reliable)
  251.                    a880104@zipi.fi.upm.es (Jare's)
  252.  
  253.            You  can  also  login  to any of these Bulletin Board Systems
  254.         and leave a message to the sysop:
  255.  
  256.         ╒═════════════════════╤═══════════╤═══════════════╤════════════╕
  257.         │BBS name             │Country    │Phone #        │Sysop       │
  258.         ╞═════════════════════╪═══════════╪═══════════════╪════════════╡
  259.         │BlasterSound (Iguana │Spain      │+34-58-293-583 │Mikel       │
  260.         │World  Headquarters) │           │               │            │
  261.         ├─────────────────────┼───────────┼───────────────┼────────────┤
  262.         │Deckard (VangeliSTeam│Spain      │+34-1-643-10-67│Pedro de Paz│
  263.         │World  Headquarters) │           │               │            │
  264.         ╘═════════════════════╧═══════════╧═══════════════╧════════════╛
  265.  
  266.  
  267.  
  268.            Technical information
  269.            ─────────────────────
  270.  
  271.            This  program  is  heavily based on the Public Domain utility
  272.         called VangeliSTracker,  also made by me. The last version up to
  273.         date of VangeliSTracker is 1.39,  and its source code is also in
  274.         the  Public  Domain,  so you can find many technical insights of
  275.         DemoVT in it.
  276.  
  277.            When  using the Silence  "output device",  the timing is done
  278.         by using the COM1 serial port and IRQ 4.  It might have problems
  279.         with some mouse drivers.  I know it's wicked, but that's the way
  280.         it's made.
  281.  
  282.            When  using  sound output through the GUS card,  the internal
  283.         timers   of   this  card  are  used,   and  the  partiture  gets
  284.         interpreted  only  through  interrupts.  Anyway,  the  Timer and
  285.         Polled modes are emulated.  No DMA is used.  The instrument data
  286.         is  kept  in  the  card's  memory.  It's  up to you to make sure
  287.         there's enough of that memory.
  288.  
  289.            When  using  Sound Blaster,  the DMA provides the timing.  It
  290.         also  takes  up more memory because of the DMA buffers involved,
  291.         and  the  instruments of the MOD are kept in main memory and UMB
  292.         memory.
  293.  
  294.            In  Timer  mode,  only  INT  1Ch (must be called a minimum of
  295.         12.5  times per second)  is used,  and the timer hardware is not
  296.         reprogrammed.
  297.  
  298.  
  299.  
  300.            Libraries provided
  301.            ──────────────────
  302.  
  303.            The  DemoVT  is designed to be used through a few routines we
  304.         provide  in  the  libraries.  They  are  provided  for Real Mode
  305.         Assembler,  PMode Assembler (Tran's PMode),  Turbo Pascal,  Real
  306.         Mode C and DPMI (Watcom) C.
  307.  
  308.            Here  you  can  find the descriptions of those routines.  The
  309.         names  used are those of the assembler interface.  To know about
  310.         the  other  interfaces  (C  and  PAS),  please,  look  into  the
  311.         interface source code and into the examples provided.
  312.  
  313.         -------------------------------- InitMusic
  314.            Call this if you want to mess with the DemoVT.  I suppose you
  315.         want  to.  It detects whether DemoVT is present (DL = 1)  or not
  316.         (DL = 0), and initalizes the above pointers.
  317.  
  318.         -------------------------------- CallMusic
  319.            Calls the player when in polled mode.  This means that if you
  320.         want  to  use the timer (IRQ 0)  for your application,  you must
  321.         manually  call  the  DemoVT  so that it will play the partiture.
  322.         This  routine must be called at least at a 50Hz average rate; if
  323.         you  don't,  the music will jump.  You can call it several times
  324.         before  making  a  long  process;  experiment how many times you
  325.         need to avoid jumps.
  326.  
  327.         -------------------------------- VTConnectTimer
  328.            Turn  on timer mode.  In this mode the player uses the system
  329.         timer  to  perform its task,  so you don't need to manually call
  330.         InitMusic.  But  you  also  can't use the timer for you.  Please
  331.         don't   hook   to  the  IRQ0  and  then  call  the  old  handler
  332.         (DemoVT's), if you want to do such a thing use the polled mode.
  333.  
  334.         -------------------------------- VTDisconnectTimer
  335.            Enter  polled  mode.  From  now  on,  make  frequent calls to
  336.         CallMusic,  and  feel  free  to do what you desire with the IRQ0
  337.         timer.
  338.  
  339.         -------------------------------- VTGetTickCounter
  340.            Reads  the  internal  50Hz  counter of the DemoVT into DX:AX.
  341.         Use  this to synchronize with the music in terms of time played.
  342.         (For  synchronization  you can also use the semaphores described
  343.         later.)
  344.  
  345.         -------------------------------- VTBeginSync
  346.            Performs   the   usual  preparations  for  calling  the  next
  347.         routines.  Call  this when you want to be a bit in sync with the
  348.         music.  If you just want a background music you won't need this,
  349.         but I'd advise you to call it anyway  'cause I'm not sure of the
  350.         behaviour (I ALWAYS call it).
  351.  
  352.         -------------------------------- VTWaitForStart
  353.            Performs  a half-second wait and initializes the tick counter
  354.         to  zero.  In  the  DemoVT,  the music always goes half a second
  355.         behind  the  partiture; this means that,  for example,  a volume
  356.         change  will  take  effect  that  half  second  later.  Use this
  357.         routine  to  prepare  yourself  for  that change.  Another place
  358.         where  you  will  want  to  use  this is at the start of a song.
  359.         Right  after  calling VTBeginSync,  there will be no music; call
  360.         VTWaitForStart,  and  it  will return at the precise moment when
  361.         the first note of the song is starting to fill your ears.
  362.  
  363.         -------------------------------- VTJumpPos
  364.            Jump to some precise pattern in the sequence (AH)  , and to a
  365.         note  inside  that  pattern  (AL).  Both  values range from 1 to
  366.         whatever.  Remeber  this,  FastTracker musicians!  The jump will
  367.         take effect half a second after you call this.
  368.  
  369.         -------------------------------- VTCheckSemaphore
  370.            Compares  AL  with  the  value of the semaphore number  'BX'.
  371.         Sempahore  values  are incremented by a special command embedded
  372.         in  the  MOD:  Command  number 8.  The parameter of this command
  373.         gives the number of the semaphore to increment.
  374.  
  375.         -------------------------------- VTSetSemaphore
  376.            Sets the value of the semaphore # BX to the value AL.  You'll
  377.         find  this  useful  to  clear the value of a semaphore that gets
  378.         set  by  a  command  in  a  pattern  that repeats several times.
  379.         Huuhh... when you need this you will know, I guess.
  380.  
  381.         -------------------------------- VTMiddleSync
  382.            Checks if the sempahore # BX is set.  If not, it jumps to the
  383.         position DH,  DL (pattern,  note)  in the MOD.  In any case,  it
  384.         waits  for  the  next  semaphore (BX +1)  to activate and exists
  385.         without jumping.
  386.            You can use this to set precise synchronization points.  When
  387.         you want to get to one (for example,  when starting some part of
  388.         a trackmo),  you want to wait for that time to come, or get back
  389.         to  it  if  it  already  passed  (by  some  slow disk reading or
  390.         something  like  that).  We used this to allow you to skip parts
  391.         of  the Inconexia trackmo and keep the music synchronized.  It's
  392.         hard  to explain; read the above description and keep it in mind
  393.         when you need something like this.
  394.  
  395.         -------------------------------- VTSetSoundVolume
  396.            Changes  the sound's volume to AL.  It will really change 1/2
  397.         second after this call.  You don't have to worry about the delay
  398.         when  you  use  this to fade the music.  Just wait half a second
  399.         after you finish fading.
  400.  
  401.         -------------------------------- VTGetSoundVolume
  402.            Reads  the  sound's  volume into AL.  Fairly straightforward,
  403.         ain't it?
  404.  
  405.  
  406.  
  407.            Software interface
  408.            ──────────────────
  409.  
  410.            If  you  are  so  nice  that  you refuse to use our wonderful
  411.         library,  then  you can try to access the DemoVT directly.  Good
  412.         luck.
  413.  
  414.            To  access the DemoVT from your program,  you must first call
  415.         the  Multiplex Interrupt DOS service (INT 2Fh).  The appropriate
  416.         setup calling sequence in assembler is the following:
  417.  
  418.                    MagicAX    = 5654h;  {'VT'}
  419.                    MagicBX    = 5472h;  {'Tr'}
  420.                    MagicCX    = 6163h;  {'ac'}
  421.                    MagicXorBX = 6B65h;  {'ke'}
  422.                    MagicXorCX = 7220h;  {'r '}
  423.  
  424.                    MOV     AX,MagicAX
  425.                    MOV     BX,MagicBX
  426.                    MOV     CX,MagicCX
  427.                    XOR     DI,DI
  428.                    MOV     ES,DI
  429.                    INT     2Fh
  430.                    XOR     DL,DL
  431.                    AND     AX,AX
  432.                    JNZ     @@no
  433.                    CMP     BX,MagicBX XOR MagicXorBX
  434.                    JNZ     @@no
  435.                    CMP     CX,MagicCX XOR MagicXorCX
  436.                    JNZ     @@no
  437.                    INC     DL
  438.            @@no:
  439.  
  440.            After this,  register DL will contain a 1 if the DemoVT is in
  441.         fact  installed,  or  a  0  if  it  is  not.  If  the  DemoVT is
  442.         installed,  then ES:DI will contain a far pointer to a character
  443.         string  in  Pascal  format  (length  byte first)  describing the
  444.         DemoVT program and version.  Also, in ES:[DI-4] is a far pointer
  445.         to  a  data  structure that contains adittional data.  Here is a
  446.         description of the data found under this pointer:
  447.  
  448.         ; These are modified by DemoVT, and you can read them.
  449.          Semaphores     DB  256  DUP(?)  ; Array of semaphores.  You can
  450.         read or
  451.                                        ; modify  them  (usually cleaning
  452.         them).
  453.  
  454.  
  455.          ChansTrig      DB  32  DUP(?) ; == 1  -> channel retriggered a
  456.         note.
  457.          NumChannels    DB ?           ; Number of channels in the MOD.
  458.  
  459.          CtrlEntryPoint DD  ?          ; Address of ther DemoVT service
  460.         proc.
  461.          TickCounter    DD  ?          ; This one provides some form for
  462.         you
  463.                                       ;  to  do  timing,  incremented at
  464.         50Hz.
  465.          RegEntryPoint  DD ?          ; DVT Service taking parm in AX.
  466.          ChansData      TChanData 32 DUP (<>) ; Per-channel info.
  467.          Note           DB ?          ; Note in the current pattern.
  468.          Seq            DB ?          ; Number of playing pattern.
  469.  
  470.                         DB 81 DUP(?)  ; Reserved.
  471.  
  472.         ;  These  are  supposed  to  be modified by you ; to tell DemoVT
  473.         your intentions. :)
  474.                         DB  ?         ; Reserved.
  475.                         DW  ?         ; Reserved.
  476.  
  477.          JumpNewPos     DB  ?         ;  Indicates that you want to jump
  478.         to
  479.                                       ; another position inside the MOD.
  480.          JumpPosSeq     DB  ?         ; Sequence position to jump to.
  481.          JumpPosNote    DB  ?         ;  Note inside the pattern to jump
  482.         to.
  483.  
  484.          SoundVolume    DB  ?         ; Put your favourite volume here.
  485.                                       ;  You  can  perform fades and the
  486.         like.
  487.                                       ; 0-255.
  488.          Abort          DB  ?          ;  Set  to 1 to force DVT to exit
  489.         after
  490.                                       ; your program exits.
  491.  
  492.                         DB 248 DUP(?) ; Reserved.
  493.  
  494.            The structure TChanData is:
  495.  
  496.         TChanData STRUC
  497.               Period DW ?
  498.               Ins    DB ?
  499.               Vol    DB ? ENDS
  500.  
  501.            Variable descriptions are as follows:
  502.  
  503.          ==========
  504.          Semaphores
  505.          ==========
  506.  
  507.            Everytime  DemoVT  finds  a  command  8  in the MOD file,  it
  508.         increments  one of the bytes in this variable.  The parameter of
  509.         the command says which of the bytes is incremented.  You can use
  510.         the  semaphores  to  synchronize your program to the music being
  511.         played. For more information, see the chapter "Synchronisation".
  512.  
  513.          =========
  514.          ChansTrig
  515.          =========
  516.  
  517.            Those  variables  are  set  to  1  when the corresponding MOD
  518.         channel retriggers a note.  You should set it to 0 when you read
  519.         it.  With this, you can implement channel non-volume bars. It is
  520.         updated with the real sound, not the half a second delay.
  521.  
  522.          ===========
  523.          NumChannels
  524.          ===========
  525.  
  526.            This is the number of channels that the MOD contains.
  527.  
  528.          ==============
  529.          CtrlEntryPoint
  530.          ==============
  531.  
  532.            This   variable  contains  a  pointer  to  the  routine  that
  533.         provides  the DemoVT services.  Service number must be pushed on
  534.         the  stack,  and none of the services requires parameters.  This
  535.         routine  can  be  called directly from Turbo Pascal.  If you are
  536.         using  the  C  language,  then  you must declare this routine as
  537.         "FAR PASCAL".
  538.  
  539.            Service numbers are:
  540.  
  541.            Service  0: Start Timer mode,  using the system timer.  After
  542.         calling this routine,  music keeps running automaticly. You must
  543.         use  this  when  you're  not  sure  if  you will be able to call
  544.         service 2 often enough (i.e.  when reading files using DOS's INT
  545.         21h).
  546.  
  547.            Service  1: Start Poll mode.  Just the opposite of service 0.
  548.         DemoVT always starts in Poll mode.  Poll mode is a better choice
  549.         when  you  need  a fine timing and/or need to synchronize to the
  550.         video retrace, which mostly happens in demos and games.
  551.  
  552.            Service  2: Call the song routine when in Poll mode.  Must be
  553.         called more than 50 times per second,  unless you're using Timer
  554.         mode (service 0). This keeps the music running.
  555.  
  556.            Service  3:  Begin  synchronization.  You  should  call  this
  557.         before  the  music starts playing.  It resets everything to make
  558.         it  an  exact  half a second wait before the sound starts coming
  559.         out.
  560.  
  561.          ===========
  562.          TickCounter
  563.          ===========
  564.  
  565.            This  variable  gets  incremented  by  DemoVT  50  times  per
  566.         second.  It's  intended for you,  to get a steady timing method,
  567.         so you can synchronize correctly with the music.
  568.  
  569.          =============
  570.          RegEntryPoint
  571.          =============
  572.  
  573.            This  is the same as the CtrlEntryPoint above,  only that the
  574.         service  number is given in the AX register.  This is needed for
  575.         DPMI interfaces.
  576.  
  577.          =========
  578.          ChansData
  579.          =========
  580.  
  581.            This  gives information on the period (the note),  the volume
  582.         and the instrument being played on each channel.
  583.  
  584.          ====
  585.          Note
  586.          Seq
  587.          ====
  588.  
  589.            This  tells  you  the  current position/note in the partiture
  590.         that is being played right now.
  591.  
  592.            Sequence  positions  and  notes are always 1-based in DemoVT.
  593.         Sequence ranges from 1 to 128 and notes from 1 to 64.
  594.  
  595.          ===========
  596.          JumpNewPos
  597.          JumpPosSeq
  598.          JumpPosNote
  599.          ===========
  600.  
  601.            Those three variables are used to jump in the music.  You are
  602.         supposed  to  know  that MOD music is made out of patterns of 64
  603.         notes  each,  and  that  patterns  are arranged in a sequence of
  604.         pattern numbers.  Well, maybe you use different names for those,
  605.         but  you'll  understand.  To force a jump in the music,  you put
  606.         the  desired  sequence position in JumpPosSeq,  the desired note
  607.         of the pattern in JumpPosNote,  and then a 1 in JumpNewPos.  The
  608.         music  will  automaticly  jump  to  that position (well,  half a
  609.         second later ;-D).
  610.  
  611.            Sequence  positions  and  notes are always 1-based in DemoVT.
  612.         Sequence ranges from 1 to 128 and notes from 1 to 64.
  613.  
  614.          ===========
  615.          SoundVolume
  616.          ===========
  617.  
  618.            You  can change this to whatever volume you want the music to
  619.         use.  It  ranges  from  0 to 255,  and the default volume is 255
  620.         (maximum).  This  does  not  correspond to the /v: switch of the
  621.         DemoVT program.  Sound volume ALWAYS ranges from 0 to 255,  with
  622.         255  corresponding  to  the  /v:  volume.  This change will take
  623.         effect half a second later.
  624.  
  625.          =====
  626.          Abort
  627.          =====
  628.  
  629.            Set  this  to  1 if you want DemoVT to exit to DOS as soon as
  630.         your  program does,  without playing any more MODs nor executing
  631.         any more programs.
  632.  
  633.            This is used to abort a demo when the user presses ESC.
  634.  
  635.          =========
  636.          reservedX
  637.          =========
  638.  
  639.            Those  are unused variables.  Don't mangle with them or maybe
  640.         your  wonderful  program  won't  work  with  future  versions of
  641.         DemoVT that support MegaBlasterSuperUltraSound WOWWHATCARD.
  642.  
  643.            <Geeezz. I sound like Mikrozoft>
  644.            <<At least I didn't call it "undocumented">>
  645.  
  646.  
  647.  
  648.            Madrid, 17th of April, 1993.
  649.  
  650.